<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">

<hibernate-mapping>
    <class name="${basePackage}.${moduleName}.${table.className}" table="${table.tableName}" schema="dbo">
		<#if (table.primaryKeys?size > 1)>
        <composite-id>
            <#list table.primaryKeys as key>
 			<key-property name="${key.javaProperty}" type="${key.getHbmType()}">
                <column name="${key.columnName}" length="${key.size}" />
            </key-property>
			</#list>
        </composite-id>
		</#if> 
		<#if (table.primaryKeys?size == 1)>
            <#list table.primaryKeys as key>
		     <id name="${key.javaProperty}" type="${key.getHbmType()}">
            	<column name="${key.columnName}" length="${key.size}" />
            <generator class="assigned" />
        	</id>
		</#list>
        
        
		</#if>    		
   		<#list table.baseColumns as column>
 			<property name="${column.javaProperty}" type="${column.getHbmType()}">
            	<column name="${column.columnName}"  length="${column.size}"/>
        	</property>
		</#list>
    </class>
</hibernate-mapping>
